<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>设置 - 邦伴用户端</title>
  <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
  <style>
    :root {
      --primary: #ff7e2d;
      --primary-light: #fff3ea;
      --border: #f0f0f0;
      --text-main: #222;
      --text-sub: #888;
    }
    
    body {
      font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
      background-color: #f8f8f8;
      color: var(--text-main);
    }
    
    .app-container {
      width: 375px;
      height: 812px;
      margin: 0 auto;
      background: #fff;
      position: relative;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
      overflow-y: auto;
    }
    
    .primary-color {
      color: var(--primary);
    }
    
    .primary-bg {
      background-color: var(--primary);
    }
    
    .primary-light-bg {
      background-color: var(--primary-light);
    }
    
    .btn-primary {
      background-color: var(--primary);
      color: white;
    }
    
    .btn-outline {
      border: 1px solid var(--primary);
      color: var(--primary);
    }
    
    .menu-item {
      display: flex;
      align-items: center;
      padding: 16px;
      border-bottom: 1px solid var(--border);
    }
    
    .menu-item:last-child {
      border-bottom: none;
    }
    
    .switch {
      position: relative;
      display: inline-block;
      width: 44px;
      height: 24px;
    }
    
    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    
    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #ccc;
      transition: .4s;
      border-radius: 24px;
    }
    
    .slider:before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: .4s;
      border-radius: 50%;
    }
    
    input:checked + .slider {
      background-color: var(--primary);
    }
    
    input:focus + .slider {
      box-shadow: 0 0 1px var(--primary);
    }
    
    input:checked + .slider:before {
      transform: translateX(20px);
    }
    
    .section-title {
      padding: 12px 16px;
      font-size: 14px;
      color: var(--text-sub);
      background-color: #f8f8f8;
    }
  </style>
</head>
<body>
  <div class="app-container">
    <!-- 顶部导航栏 -->
    <div class="sticky top-0 z-10 bg-white border-b border-gray-100 px-4 py-3 flex items-center">
      <a href="javascript:history.back()" class="mr-2">
        <i class="fas fa-arrow-left text-lg"></i>
      </a>
      <h1 class="text-lg font-medium flex-1 text-center">设置</h1>
    </div>
    
    <!-- 账号安全 -->
    <div class="section-title">账号安全</div>
    <div class="bg-white">
      <a href="change_password.html" class="menu-item">
        <span>修改密码</span>
        <i class="fas fa-chevron-right text-gray-300 ml-auto"></i>
      </a>
      <a href="bind_phone.html" class="menu-item">
        <span>手机绑定</span>
        <span class="ml-auto text-sm text-gray-500">138****6789</span>
        <i class="fas fa-chevron-right text-gray-300 ml-2"></i>
      </a>
      <a href="payment_settings.html" class="menu-item">
        <span>支付设置</span>
        <i class="fas fa-chevron-right text-gray-300 ml-auto"></i>
      </a>
    </div>
    
    <!-- 消息通知 -->
    <div class="section-title">消息通知</div>
    <div class="bg-white">
      <div class="menu-item">
        <span>接收订单通知</span>
        <label class="switch ml-auto">
          <input type="checkbox" checked>
          <span class="slider"></span>
        </label>
      </div>
      <div class="menu-item">
        <span>接收活动通知</span>
        <label class="switch ml-auto">
          <input type="checkbox" checked>
          <span class="slider"></span>
        </label>
      </div>
      <div class="menu-item">
        <span>接收系统通知</span>
        <label class="switch ml-auto">
          <input type="checkbox" checked>
          <span class="slider"></span>
        </label>
      </div>
      <a href="notification_settings.html" class="menu-item">
        <span>通知设置</span>
        <i class="fas fa-chevron-right text-gray-300 ml-auto"></i>
      </a>
    </div>
    
    <!-- 隐私设置 -->
    <div class="section-title">隐私设置</div>
    <div class="bg-white">
      <a href="privacy_settings.html" class="menu-item">
        <span>隐私政策</span>
        <i class="fas fa-chevron-right text-gray-300 ml-auto"></i>
      </a>
      <div class="menu-item">
        <span>位置信息</span>
        <label class="switch ml-auto">
          <input type="checkbox" checked>
          <span class="slider"></span>
        </label>
      </div>
      <div class="menu-item">
        <span>个性化推荐</span>
        <label class="switch ml-auto">
          <input type="checkbox" checked>
          <span class="slider"></span>
        </label>
      </div>
    </div>
    
    <!-- 通用设置 -->
    <div class="section-title">通用设置</div>
    <div class="bg-white">
      <a href="language_settings.html" class="menu-item">
        <span>语言设置</span>
        <span class="ml-auto text-sm text-gray-500">简体中文</span>
        <i class="fas fa-chevron-right text-gray-300 ml-2"></i>
      </a>
      <a href="clear_cache.html" class="menu-item">
        <span>清除缓存</span>
        <span class="ml-auto text-sm text-gray-500">23.5MB</span>
        <i class="fas fa-chevron-right text-gray-300 ml-2"></i>
      </a>
      <a href="check_update.html" class="menu-item">
        <span>检查更新</span>
        <span class="ml-auto text-sm text-gray-500">当前版本 v2.3.1</span>
        <i class="fas fa-chevron-right text-gray-300 ml-2"></i>
      </a>
    </div>
    
    <!-- 关于我们 -->
    <div class="section-title">关于我们</div>
    <div class="bg-white">
      <a href="about.html" class="menu-item">
        <span>关于邦伴</span>
        <i class="fas fa-chevron-right text-gray-300 ml-auto"></i>
      </a>
      <a href="user_agreement.html" class="menu-item">
        <span>用户协议</span>
        <i class="fas fa-chevron-right text-gray-300 ml-auto"></i>
      </a>
      <a href="feedback.html" class="menu-item">
        <span>意见反馈</span>
        <i class="fas fa-chevron-right text-gray-300 ml-auto"></i>
      </a>
    </div>
    
    <!-- 退出登录 -->
    <div class="p-4">
      <button id="logoutBtn" class="w-full py-3 text-center text-red-500 bg-white rounded-lg border border-gray-200">退出登录</button>
    </div>
    
    <!-- 退出确认弹窗 -->
    <div id="logoutModal" class="fixed inset-0 bg-black bg-opacity-50 hidden flex items-center justify-center z-50">
      <div class="bg-white rounded-lg w-72 overflow-hidden">
        <div class="p-4 text-center">
          <h3 class="font-medium mb-2">确认退出</h3>
          <p class="text-sm text-gray-500">确定要退出登录吗？</p>
        </div>
        <div class="flex border-t border-gray-100">
          <button id="cancelLogout" class="flex-1 py-3 text-center text-gray-500">取消</button>
          <button id="confirmLogout" class="flex-1 py-3 text-center text-red-500">确定</button>
        </div>
      </div>
    </div>
  </div>

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      // 退出登录
      const logoutBtn = document.getElementById('logoutBtn');
      const logoutModal = document.getElementById('logoutModal');
      const cancelLogout = document.getElementById('cancelLogout');
      const confirmLogout = document.getElementById('confirmLogout');
      
      logoutBtn.addEventListener('click', function() {
        logoutModal.classList.remove('hidden');
        logoutModal.classList.add('flex');
      });
      
      cancelLogout.addEventListener('click', function() {
        logoutModal.classList.add('hidden');
        logoutModal.classList.remove('flex');
      });
      
      confirmLogout.addEventListener('click', function() {
        // 这里可以添加退出登录的逻辑
        window.location.href = 'login.html';
      });
      
      // 点击弹窗外部关闭
      logoutModal.addEventListener('click', function(e) {
        if (e.target === logoutModal) {
          cancelLogout.click();
        }
      });
      
      // 开关切换
      const switches = document.querySelectorAll('.switch input');
      switches.forEach(switchInput => {
        switchInput.addEventListener('change', function() {
          console.log(`开关状态: ${this.checked ? '开启' : '关闭'}`);
          // 这里可以添加开关状态变化的逻辑
        });
      });
      
      // 清除缓存
      const clearCacheLink = document.querySelector('a[href="clear_cache.html"]');
      clearCacheLink.addEventListener('click', function(e) {
        e.preventDefault();
        if (confirm('确定要清除缓存吗？')) {
          // 这里可以添加清除缓存的逻辑
          const cacheSize = this.querySelector('.text-sm.text-gray-500');
          cacheSize.textContent = '0KB';
          alert('缓存已清除');
        }
      });
      
      // 检查更新
      const checkUpdateLink = document.querySelector('a[href="check_update.html"]');
      checkUpdateLink.addEventListener('click', function(e) {
        e.preventDefault();
        // 这里可以添加检查更新的逻辑
        alert('当前已是最新版本');
      });
    });
  </script>
</body>
</html> 